home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
ip
/
ka9q
/
src.arc
/
KISSDUMP.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-08-19
|
1KB
|
66 lines
#include "global.h"
#include "mbuf.h"
#include "kiss.h"
#include "ax25.h"
#include "trace.h"
void
ki_dump(bpp,check)
struct mbuf **bpp;
int check;
{
char type;
char val;
printf("KISS: ");
pullup(bpp,(char *)&type,1);
if(uchar(type) == KISS_DATA){
printf("Data\n");
ax25_dump(bpp,check);
return;
}
pullup(bpp,(char *)&val,1);
switch(uchar(type)){
case KISS_TXD:
printf("TX Delay: %lu ms\n",uchar(val) * 10L);
break;
case KISS_P:
printf("Persistence: %u/256\n",uchar(val) + 1);
break;
case KISS_ST:
printf("Slot time: %lu ms\n",uchar(val) * 10L);
break;
case KISS_TXT:
printf("TX Tail time: %lu ms\n",uchar(val) * 10L);
break;
case KISS_FD:
printf("Duplex: %s\n",uchar(val) == 0 ? "Half" : "Full");
break;
case KISS_HW:
printf("Hardware %u\n",uchar(val));
break;
case KISS_RETURN:
printf("RETURN\n");
break;
default:
printf("code %u arg %u\n",uchar(type),uchar(val));
break;
}
}
int
ki_forus(iface,bp)
struct iface *iface;
struct mbuf *bp;
{
struct mbuf *bpp;
int i;
if(bp->data[0] != KISS_DATA)
return 0;
dup_p(&bpp,bp,1,AXALEN);
i = ax_forus(iface,bpp);
free_p(bpp);
return i;
}